<template>
	<view class="">
		子组件
		<button @click="$emit('add', Math.random())">按钮</button>
		<input type="text" @input="onInput" />
	</view>
</template>

<script setup>
	const emit = defineEmits(["change"]);

	function onInput(e) {
		emit("change", e.detail.value);
	}
</script>

<style lang="scss" scoped>
	input {
		height: 40px;
		border: 1px solid #cfcfcf;
	}
</style>